<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Title</title>
    <!--1.引入外部的vue.js-->
    <script src="./js/vue@3.3.4.global.js"></script>

</head>
<body>
    <!--2.view-->
    <div id="app">
         {{message}}

    </div>
</body>
<!--3.view-model-->
<script>
    const app = Vue.createApp({
        /*model*/
       data(){
          return {
              message: 'hello Vue3',
          }
       },
        //函数
        methods:{

        },
        /*创建前*/
        beforeCreate(){
            console.log("----beforeCreate---")
            //已经有实例，有this了，但是data()中的数据没有加载
            console.log("message:",this.message)
        },
        /*挂载前*/
        beforeMount(){
            console.log("----beforeMount---")
            console.log("message:",this.message)
        },
        /*挂载*/
        mounted(){
            console.log("----mounted---")
            console.log("message:",this.message)
            //更改值
            this.message = "jack and rose";
        }
    });
    /*4.挂载*/
    app.mount('#app');
</script>
</html>